package com.gopay.common.util.xml.utils.converters;

import com.gopay.common.util.xml.utils.Converter;

public abstract class AbstractConverter implements Converter {

	private Object defaultValue;

	protected boolean isUseDefaultValue = false;

	protected void setDefaultValue(Object defaultValue) {
		try {
			if (defaultValue == null) {
				this.defaultValue = null;
			} else {
				this.defaultValue = convert(defaultValue);
			}
		} catch (Exception e) {
			throw new RuntimeException("", e);
		}
	}

	public Object getDefaultValue() {
		return defaultValue;
	}
}
